/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managedBeans;

import java.util.Map;
import javax.faces.bean.ManagedBean;
import javax.faces.component.html.HtmlCommandLink;
import javax.faces.context.FacesContext;

/**
 *
 * @author David
 */
@ManagedBean
public class indexSearchMB {
    
    private String category;
    private String university;
    private HtmlCommandLink command;
    /**
     * Creates a new instance of indexSearchMB
     */
    public indexSearchMB() {
    }

    /**
     * @return the category
     */
    public String getCategory() {
        return category;
    }

    /**
     * @param category the category to set
     */
    public void setCategory(String category) {
        this.category = category;
    }

    /**
     * @return the university
     */
    public String getUniversity() {
        return university;
    }

    /**
     * @param university the university to set
     */
    public void setUniversity(String university) {
        this.university = university;
    }
    
    public void changeCategory() {
        FacesContext fc = FacesContext.getCurrentInstance();
        Map<String,String> params = fc.getExternalContext().getRequestParameterMap();
        this.setCategory(params.get("category"));
    }
    
    public void changeUniversity() {
        FacesContext fc = FacesContext.getCurrentInstance();
        Map<String,String> params = fc.getExternalContext().getRequestParameterMap();
        this.setUniversity(params.get("university"));
    }

    /**
     * @return the command
     */
    public HtmlCommandLink getCommand() {
        return command;
    }

    /**
     * @param command the command to set
     */
    public void setCommand(HtmlCommandLink command) {
        this.command = command;
    }
}
